import React, {useState,Fragment}from 'react'
// 函数式组件button
export default function FuncButton() {
    const [num,setNum] = useState(1)
    const addNum = ()=>{
        setNum(num=>num+1)
    }
  return (
    <>
        <h2>数字为：{num}</h2>
        <button onClick={addNum}>累加</button>
    </>
  )
}
